<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>搜索管理后台 - 搜索评估</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link rel="stylesheet" type="text/css" href="${request.contextPath}/css/style.css">
	<script type="text/javascript" src="${request.contextPath}/js/jquery-1.4.2.js"></script>
	<script type="text/javascript" src="${request.contextPath}/js/main.js"></script>
	<script type="text/javascript" src="${request.contextPath}/js/my97/WdatePicker.js"></script>
	
	<script type="text/javascript">
	var cache_info = [];
	$(function(){
		initSortBean();
		list(1);
	});
	function clearInput() {
		$('#bdate,#edate,#keyword').val('');
		list(1);
	}
	
	function showInfo(kid, o){
		if(cache_info[kid]){
			showData(cache_info[kid], o);
		}else{
			jQuery.ajax({
				url : 'tweightInfo?keyword=' + kid,
				type : 'get',
				success : function(json) {
					if(json != null && json.length > 2) {
						var obj = eval(json)[0];
						cache_info[kid] = obj;
						showData(obj, o);
					}else{
						showData(null, o);
					}
				}
			});
		}
	}
	function showData(obj, o) {
		var h = '';
		var t = '';
		if(obj) {
			var kid = obj.keyId;
			var key = obj.key;
			var list = obj.beans;
			
			t = key;
			h =  '<table style="width:320px;margin:auto;border-collapse:collapse;">';
			h += '	<tr>';
			h += '		<td>页码（n）</td>';
			h += '		<td>正确（r）</td>';
			h += '		<td>错误（w）</td>';
			h += '		<td>权重（R）</td>';
			h += '	</tr>';
			
			for(var i = 0, len = list.length; i < len; i ++){
				var l = list[i];
				h += '	<tr>';
				h += '		<td>' + l.page + '</td>';
				h += '		<td>' + l.right + '</td>';
				h += '		<td>' + l.wrong + '</td>';
				h += '		<td>' + l.weight + '</td>';
				h += '	</tr>';
			}
			h += '</table>';
		}else{
			t = $(o).parents('tr').children('td.td1').eq(0).find('a').html();
			h = '没有数据';
		}
		$('#infoCtn').html(h);
		$('#infoTitle').html(t);
		$('#infoDiv').showPop();
	}
	</script>
  </head>
  
  <body>
  	<div style="margin:10px auto 10px 20px;width:100%;text-align:left;">
  		<h2>评测词库管理</h2>
  	</div>
  	<div class="mainDiv" style="text-align:left;">
		日期：从
		
		<input type="text" class="inputBox" value="" readOnly="readOnly" onclick="WdatePicker({el:'bdate',dateFmt:'yyyy-MM-dd HH:mm:ss'});" id="bdate" size="16" />
		到
		<input type="text" class="inputBox" value="" readOnly="readOnly" id="edate" size="16" onclick="WdatePicker({el:'edate',dateFmt:'yyyy-MM-dd HH:mm:ss'});" />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<br />关键字：&nbsp;<input type="text" class="inputBox" id="keyword" value="" size="40" />
		<input type="button" value="搜索" class="btnStyle1" size="8" onclick="list(1);" />&nbsp;&nbsp;
		<a href="javascript:void(0);" class="link_" onclick="clearInput();" >清空条件</a>&nbsp;&nbsp;&nbsp;
		<span style="float:right;">
			<a href="tsingleAdd" target="_blank" class="link_">添加关键字</a>&nbsp;&nbsp;
			<a href="tviewAdd" class="link_">批量添加</a>
		</span>
  	</div><br />
  	<div class="mainDiv" id="resultDiv">
  		
  	</div>
  	<div class="mainDiv">
  		<div style="float:left;padding-top:6px;">
  			最后一次平均查准率：<span style="color:red;font-weight:bold;">${averageRate*100}%</span>
  			<span style="color:#aaaaaa;">（查准率不为零的平均值）</span>
  		</div>
  		<div id="pageNum" style="float:right;padding-right:2px;">
  		
  		</div>
  	</div>
  	
  		<!--
  	<div id="infoDiv" style="width:400px;height:300px;border-radius:8px;background-color:white;display:none;">
  		<div id="infoTitle" style="padding-top:10px;padding-bottom:10px;font-weight:bold;color:red;font-size:14px;">
  			女装
  		</div>
  		<div style="color:#bbbbbb;font-size:11px;margin-bottom:5px;">
  			查准率计算的明细数据（实时）
  		</div>
  		<div id="infoCtn">
  			
  		</div>
  		
  		<div style="margin-top:11px;color:#222222;font-size:11px;">
  			<div style="text-align:left;padding-left:40px;">计算公式：</div>
  			f(n) = [ r<sub>n</sub> / (r<sub>n</sub> + w<sub>n</sub>) ] * R<sub>n</sub> ;<br />
  			<table border="0" style="border:none;border-collapse:collapse;width:250px;margin:auto;">
  				<tr>
  					<td style="border:none;">查准率 = </td>
  					<td style="border:none;">
  						<div style="border-bottom:1px solid #000000;">
  							[ f(1) + f(2) + ... + f(n) ]
  						</div>
  						(R<sub>1</sub> + R<sub>2</sub> + ... + R<sub>n</sub>)
  					</td>
  				</tr>
  			</table>
  		</div>
  	</div>
  		 -->
  </body>
</html>
